<!--
 * @Author: your name
 * @Date: 2021-05-29 14:37:49
 * @LastEditTime: 2021-06-02 10:09:44
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \遵义报名\zunyi\src\views\remove\remove.vue
-->
<template>
  <div>
    <button @click="remove">清空账号</button>
    {{this.$store.state.userInfo.num}}
    <button @click="add">按钮</button>
  </div>
</template>

<script>
import {url} from "api/logout.js"
export default {
  methods:{
    async remove(){
      let res = await this.$httpRequest({
        url:url,
        method:"POST",
        data:{}
      })
      console.log(res);
      //清除在localStorage储存的账号信息
      localStorage.clear()
    },
    add(){
      this.$store.commit("userInfo/add")
    }
  }
}
</script>

<style>

</style>